﻿using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace ZY19.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TypeController : ControllerBase
    {
        public TypeController(ITypeBLL bll)
        {
            Bll = bll;
        }

        public ITypeBLL Bll { get; }
        [HttpPost]
        public Task<int> AddType(TypeModel type)
        {
            return Bll.AddType(type);
        }
        [HttpGet]
        public List<TypeModel> GetTypes()
        {
            return Bll.GetTypes();
        }
    }
}
